Integrand size = 33, antiderivative size = 462 \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=-\frac {b g^{5/2} \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}+\frac {\left (-a^2+b^2\right )^{3/4} g^{5/2} \arctan \left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \sqrt {b} f}+\frac {b g^{5/2} \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}-\frac {\left (-a^2+b^2\right )^{3/4} g^{5/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \sqrt {b} f}-\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}-\frac {g^2 \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{a f \sqrt {\cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b-\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b+\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}} \]
[Out]
Time = 0.84 (sec) , antiderivative size = 462, normalized size of antiderivative = 1.00, number of steps used = 24, number of rules used = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.515, Rules used = {2977, 2645, 327, 335, 304, 209, 212, 2647, 2721, 2719, 2774, 2946, 2780, 2886, 2884, 211, 214} \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\frac {g^{5/2} \left (b^2-a^2\right )^{3/4} \arctan \left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt [4]{b^2-a^2}}\right )}{a^2 \sqrt {b} f}-\frac {b g^{5/2} \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}-\frac {g^{5/2} \left (b^2-a^2\right )^{3/4} \text {arctanh}\left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt {g} \sqrt [4]{b^2-a^2}}\right )}{a^2 \sqrt {b} f}+\frac {b g^{5/2} \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}-\frac {g^3 \left (a^2-b^2\right ) \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {b^2-a^2}},\frac {1}{2} (e+f x),2\right )}{a b f \left (b-\sqrt {b^2-a^2}\right ) \sqrt {g \cos (e+f x)}}-\frac {g^3 \left (a^2-b^2\right ) \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {b^2-a^2}},\frac {1}{2} (e+f x),2\right )}{a b f \left (\sqrt {b^2-a^2}+b\right ) \sqrt {g \cos (e+f x)}}-\frac {g^2 E\left (\left .\frac {1}{2} (e+f x)\right |2\right ) \sqrt {g \cos (e+f x)}}{a f \sqrt {\cos (e+f x)}}-\frac {g \csc (e+f x) (g \cos (e+f x))^{3/2}}{a f} \]
[In]
[Out]
Rule 209
Rule 211
Rule 212
Rule 214
Rule 304
Rule 327
Rule 335
Rule 2645
Rule 2647
Rule 2719
Rule 2721
Rule 2774
Rule 2780
Rule 2884
Rule 2886
Rule 2946
Rule 2977
Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {b (g \cos (e+f x))^{5/2} \csc (e+f x)}{a^2}+\frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a}+\frac {b^2 (g \cos (e+f x))^{5/2}}{a^2 (a+b \sin (e+f x))}\right ) \, dx \\ & = \frac {\int (g \cos (e+f x))^{5/2} \csc ^2(e+f x) \, dx}{a}-\frac {b \int (g \cos (e+f x))^{5/2} \csc (e+f x) \, dx}{a^2}+\frac {b^2 \int \frac {(g \cos (e+f x))^{5/2}}{a+b \sin (e+f x)} \, dx}{a^2} \\ & = \frac {2 b g (g \cos (e+f x))^{3/2}}{3 a^2 f}-\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}+\frac {b \text {Subst}\left (\int \frac {x^{5/2}}{1-\frac {x^2}{g^2}} \, dx,x,g \cos (e+f x)\right )}{a^2 f g}-\frac {\left (3 g^2\right ) \int \sqrt {g \cos (e+f x)} \, dx}{2 a}+\frac {\left (b g^2\right ) \int \frac {\sqrt {g \cos (e+f x)} (b+a \sin (e+f x))}{a+b \sin (e+f x)} \, dx}{a^2} \\ & = -\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}+\frac {(b g) \text {Subst}\left (\int \frac {\sqrt {x}}{1-\frac {x^2}{g^2}} \, dx,x,g \cos (e+f x)\right )}{a^2 f}+\frac {g^2 \int \sqrt {g \cos (e+f x)} \, dx}{a}+\frac {\left (\left (-a^2+b^2\right ) g^2\right ) \int \frac {\sqrt {g \cos (e+f x)}}{a+b \sin (e+f x)} \, dx}{a^2}-\frac {\left (3 g^2 \sqrt {g \cos (e+f x)}\right ) \int \sqrt {\cos (e+f x)} \, dx}{2 a \sqrt {\cos (e+f x)}} \\ & = -\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}-\frac {3 g^2 \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{a f \sqrt {\cos (e+f x)}}+\frac {(2 b g) \text {Subst}\left (\int \frac {x^2}{1-\frac {x^4}{g^2}} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f}+\frac {\left (\left (a^2-b^2\right ) g^3\right ) \int \frac {1}{\sqrt {g \cos (e+f x)} \left (\sqrt {-a^2+b^2}-b \cos (e+f x)\right )} \, dx}{2 a b}-\frac {\left (\left (a^2-b^2\right ) g^3\right ) \int \frac {1}{\sqrt {g \cos (e+f x)} \left (\sqrt {-a^2+b^2}+b \cos (e+f x)\right )} \, dx}{2 a b}-\frac {\left (b \left (a^2-b^2\right ) g^3\right ) \text {Subst}\left (\int \frac {\sqrt {x}}{\left (a^2-b^2\right ) g^2+b^2 x^2} \, dx,x,g \cos (e+f x)\right )}{a^2 f}+\frac {\left (g^2 \sqrt {g \cos (e+f x)}\right ) \int \sqrt {\cos (e+f x)} \, dx}{a \sqrt {\cos (e+f x)}} \\ & = -\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}-\frac {g^2 \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{a f \sqrt {\cos (e+f x)}}+\frac {\left (b g^3\right ) \text {Subst}\left (\int \frac {1}{g-x^2} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f}-\frac {\left (b g^3\right ) \text {Subst}\left (\int \frac {1}{g+x^2} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f}-\frac {\left (2 b \left (a^2-b^2\right ) g^3\right ) \text {Subst}\left (\int \frac {x^2}{\left (a^2-b^2\right ) g^2+b^2 x^4} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f}+\frac {\left (\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)}\right ) \int \frac {1}{\sqrt {\cos (e+f x)} \left (\sqrt {-a^2+b^2}-b \cos (e+f x)\right )} \, dx}{2 a b \sqrt {g \cos (e+f x)}}-\frac {\left (\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)}\right ) \int \frac {1}{\sqrt {\cos (e+f x)} \left (\sqrt {-a^2+b^2}+b \cos (e+f x)\right )} \, dx}{2 a b \sqrt {g \cos (e+f x)}} \\ & = -\frac {b g^{5/2} \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}+\frac {b g^{5/2} \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}-\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}-\frac {g^2 \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{a f \sqrt {\cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b-\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b+\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}}+\frac {\left (\left (a^2-b^2\right ) g^3\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-a^2+b^2} g-b x^2} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f}-\frac {\left (\left (a^2-b^2\right ) g^3\right ) \text {Subst}\left (\int \frac {1}{\sqrt {-a^2+b^2} g+b x^2} \, dx,x,\sqrt {g \cos (e+f x)}\right )}{a^2 f} \\ & = -\frac {b g^{5/2} \arctan \left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}+\frac {\left (-a^2+b^2\right )^{3/4} g^{5/2} \arctan \left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \sqrt {b} f}+\frac {b g^{5/2} \text {arctanh}\left (\frac {\sqrt {g \cos (e+f x)}}{\sqrt {g}}\right )}{a^2 f}-\frac {\left (-a^2+b^2\right )^{3/4} g^{5/2} \text {arctanh}\left (\frac {\sqrt {b} \sqrt {g \cos (e+f x)}}{\sqrt [4]{-a^2+b^2} \sqrt {g}}\right )}{a^2 \sqrt {b} f}-\frac {g (g \cos (e+f x))^{3/2} \csc (e+f x)}{a f}-\frac {g^2 \sqrt {g \cos (e+f x)} E\left (\left .\frac {1}{2} (e+f x)\right |2\right )}{a f \sqrt {\cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b-\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b-\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}}-\frac {\left (a^2-b^2\right ) g^3 \sqrt {\cos (e+f x)} \operatorname {EllipticPi}\left (\frac {2 b}{b+\sqrt {-a^2+b^2}},\frac {1}{2} (e+f x),2\right )}{a b \left (b+\sqrt {-a^2+b^2}\right ) f \sqrt {g \cos (e+f x)}} \\ \end{align*}
Result contains higher order function than in optimal. Order 6 vs. order 4 in optimal.
Time = 23.11 (sec) , antiderivative size = 1465, normalized size of antiderivative = 3.17 \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\frac {(g \cos (e+f x))^{5/2} \left (-4 \cos ^{\frac {3}{2}}(e+f x) \csc (e+f x)-\frac {5 b \csc (e+f x) \left (8 a b \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{2},1,\frac {7}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right ) \cos ^{\frac {3}{2}}(e+f x)+3 \left (2 \sqrt {2} \sqrt {b} \left (a^2-b^2\right )^{3/4} \arctan \left (1-\frac {\sqrt {2} \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{a^2-b^2}}\right )-2 \sqrt {2} \sqrt {b} \left (a^2-b^2\right )^{3/4} \arctan \left (1+\frac {\sqrt {2} \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{a^2-b^2}}\right )+4 a^2 \arctan \left (\sqrt {\cos (e+f x)}\right )-4 b^2 \arctan \left (\sqrt {\cos (e+f x)}\right )+2 a^2 \log \left (1-\sqrt {\cos (e+f x)}\right )-2 b^2 \log \left (1-\sqrt {\cos (e+f x)}\right )-2 a^2 \log \left (1+\sqrt {\cos (e+f x)}\right )+2 b^2 \log \left (1+\sqrt {\cos (e+f x)}\right )-\sqrt {2} \sqrt {b} \left (a^2-b^2\right )^{3/4} \log \left (\sqrt {a^2-b^2}-\sqrt {2} \sqrt {b} \sqrt [4]{a^2-b^2} \sqrt {\cos (e+f x)}+b \cos (e+f x)\right )+\sqrt {2} \sqrt {b} \left (a^2-b^2\right )^{3/4} \log \left (\sqrt {a^2-b^2}+\sqrt {2} \sqrt {b} \sqrt [4]{a^2-b^2} \sqrt {\cos (e+f x)}+b \cos (e+f x)\right )\right )\right ) \left (a+b \sqrt {\sin ^2(e+f x)}\right )}{12 a \left (a^2-b^2\right ) (b+a \csc (e+f x))}+\frac {12 a \left (\frac {a \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{2},1,\frac {7}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right ) \cos ^{\frac {3}{2}}(e+f x)}{3 \left (a^2-b^2\right )}+\frac {\left (\frac {1}{8}+\frac {i}{8}\right ) \left (2 \arctan \left (1-\frac {(1+i) \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{-a^2+b^2}}\right )-2 \arctan \left (1+\frac {(1+i) \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{-a^2+b^2}}\right )-\log \left (\sqrt {-a^2+b^2}-(1+i) \sqrt {b} \sqrt [4]{-a^2+b^2} \sqrt {\cos (e+f x)}+i b \cos (e+f x)\right )+\log \left (\sqrt {-a^2+b^2}+(1+i) \sqrt {b} \sqrt [4]{-a^2+b^2} \sqrt {\cos (e+f x)}+i b \cos (e+f x)\right )\right )}{\sqrt {b} \sqrt [4]{-a^2+b^2}}\right ) \left (a+b \sqrt {\sin ^2(e+f x)}\right )}{(b+a \csc (e+f x)) \sqrt {\sin ^2(e+f x)}}+\frac {\left (-42 \sqrt {2} \left (a^2-b^2\right )^{3/4} \left (2 a^2-b^2\right ) \arctan \left (1-\frac {\sqrt {2} \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{a^2-b^2}}\right )+42 \sqrt {2} \left (a^2-b^2\right )^{3/4} \left (2 a^2-b^2\right ) \arctan \left (1+\frac {\sqrt {2} \sqrt {b} \sqrt {\cos (e+f x)}}{\sqrt [4]{a^2-b^2}}\right )+84 b^{3/2} \left (a^2-b^2\right ) \arctan \left (\sqrt {\cos (e+f x)}\right )-56 a b^{5/2} \operatorname {AppellF1}\left (\frac {3}{4},\frac {1}{2},1,\frac {7}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right ) \cos ^{\frac {3}{2}}(e+f x)+48 a b^{5/2} \operatorname {AppellF1}\left (\frac {7}{4},\frac {1}{2},1,\frac {11}{4},\cos ^2(e+f x),\frac {b^2 \cos ^2(e+f x)}{-a^2+b^2}\right ) \cos ^{\frac {7}{2}}(e+f x)+42 b^{3/2} \left (a^2-b^2\right ) \log \left (1-\sqrt {\cos (e+f x)}\right )+42 b^{3/2} \left (-a^2+b^2\right ) \log \left (1+\sqrt {\cos (e+f x)}\right )+21 \sqrt {2} \left (a^2-b^2\right )^{3/4} \left (2 a^2-b^2\right ) \log \left (\sqrt {a^2-b^2}-\sqrt {2} \sqrt {b} \sqrt [4]{a^2-b^2} \sqrt {\cos (e+f x)}+b \cos (e+f x)\right )-21 \sqrt {2} \left (a^2-b^2\right )^{3/4} \left (2 a^2-b^2\right ) \log \left (\sqrt {a^2-b^2}+\sqrt {2} \sqrt {b} \sqrt [4]{a^2-b^2} \sqrt {\cos (e+f x)}+b \cos (e+f x)\right )\right ) \left (a+b \sqrt {\sin ^2(e+f x)}\right )}{84 a \sqrt {b} \left (a^2-b^2\right ) (a+b \sin (e+f x))}\right )}{4 a f \cos ^{\frac {5}{2}}(e+f x)} \]
[In]
[Out]
Result contains higher order function than in optimal. Order 9 vs. order 4.
Time = 24.84 (sec) , antiderivative size = 1484, normalized size of antiderivative = 3.21
[In]
[Out]
\[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\int { \frac {\left (g \cos \left (f x + e\right )\right )^{\frac {5}{2}} \csc \left (f x + e\right )^{2}}{b \sin \left (f x + e\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\text {Timed out} \]
[In]
[Out]
Exception generated. \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\int { \frac {\left (g \cos \left (f x + e\right )\right )^{\frac {5}{2}} \csc \left (f x + e\right )^{2}}{b \sin \left (f x + e\right ) + a} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(g \cos (e+f x))^{5/2} \csc ^2(e+f x)}{a+b \sin (e+f x)} \, dx=\int \frac {{\left (g\,\cos \left (e+f\,x\right )\right )}^{5/2}}{{\sin \left (e+f\,x\right )}^2\,\left (a+b\,\sin \left (e+f\,x\right )\right )} \,d x \]
[In]
[Out]